package com.hspedu.homework;

import java.io.*;

/**
 * @author 谷其昊
 * @version 1.0
 * @date 2022/2/26
 * @time 19:22
 */
public class Homewrok02 {
    public static void main(String[] args) throws IOException {
        File file = new File("D:\\BaiduNetdiskDownload\\韩顺平2021基础学Java\\temp\\news5.txt");
        String line;
        InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(file), "gbk");
        int i = 0;
        BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
        while((line = bufferedReader.readLine())!=null){
            System.out.println("第"+(++i)+"行："+line);
        }
        if (bufferedReader != null){
            bufferedReader.close();
        }
    }
}
